package com.imboss.sell.dataobject;

import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;





/**
 * @ClassName 类目
 * @Description 类目
 * @Author 钟鲁超
 * @Date 2019/2/28 0028 上午 10:20
 **/
/*数据库映射成对象
 * 动态更新时间
 * 自动带get、set、toString方法*/

@Entity
@DynamicUpdate
@Data
//@EntityListeners(AuditingEntityListener.class)
public class ProductCategory {
    /*类目id*/
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private  Integer categoryId;
    /*类目名称*/
    private String categoryName;
    /*类目编号*/
    private Integer categoryType;

//    @CreatedDate
    private Date createTime;

//    @LastModifiedDate
    private Date updateTime;

    public ProductCategory() {
    }

    public ProductCategory(String categoryName, Integer categoryType) {
        this.categoryName = categoryName;
        this.categoryType = categoryType;
    }
}
